package com.zcb.myrxjavathreecache.tools.api;


import com.zcb.myrxjavathreecache.modle.ImageEntity;

import java.util.Map;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;

/**
 * Created by admin on 2016/11/15.
 */

public interface ApiService {

    public static final String BASE_URL="http://gank.io/api/";



    //后台用户注册user/register
    @FormUrlEncoded
    @POST("user/register")
    Observable<HttpResult> userRegister(@FieldMap Map<String, String> map);


    //发送验证码user/sendVerify
    @FormUrlEncoded
    @POST("user/sendVerify")
    Observable<HttpResult> sendValidNum(@FieldMap Map<String, String> map);


    //验证验证码
    @FormUrlEncoded
//    @Headers("Content-Type: text/html;charset=UTF-8")
    @POST("user/checkVerify")
    Observable<String> checkValidNum(@FieldMap Map<String, String> map);


    //登录user/login
    @FormUrlEncoded
    @POST("user/login")
    Observable<String> userloginOn(@FieldMap Map<String, String> map);


    //查询
    @FormUrlEncoded
    @POST("user-web/api/cloudcc/forward/v1")
    Observable<HttpResult> querycommon(@FieldMap Map<String, String> map);


    //扫描审核中的验证码scan/updatePartyVerify
//    @Headers({
//            "Content-Type:application/json"
//    })
    @FormUrlEncoded
    @POST("scan/updatePartyVerify")
    Observable<HttpResult> scanPartyVerify(@FieldMap Map<String, String> map);


    //扫描入场中的验证码
    @FormUrlEncoded
    @POST("scan/updatePartyTicket")
    Observable<HttpResult> scanPartyTicket(@FieldMap Map<String, String> map);


    //上传头像:方法一，不能使用
//    @Multipart
//    @POST("user/uploadAvatar")
    @POST("user/uploadAvatar")
    Observable<String> uploadImg(@FieldMap Map<String, Object> map);

    /**
     * 上传多头像
     */
//    @Multipart
//    @POST("user/uploadAvatar")
//    Observable<String> uploadMemberIcon(@Part List<MultipartBody.Part> partList);




    //上传头像:方法二，不能使用
//    @POST("user/uploadAvatar")
//    @POST("wzly/uploadImg")
//    Observable<String> uploadImg2(@Body RequestBody body);



    //测试上传头像
//    @Multipart
//    @POST("wzly/uploadImg")
//    Observable<UploadImgResult> uploadImg(@Part MultipartBody.Part file);


    @GET("data/%E7%A6%8F%E5%88%A9/{pageSize}/{pageNum}")
    Observable<ImageEntity> getImages(@Path("pageSize") int pageSize, @Path("pageNum") int pageNum);












}
